import math
def cal_divorce(x1,y1,x2,y2,x3,y3):
    a = math.sqrt((x1-x2)**2+(y1-y2)**2)
    b = math.sqrt((x2-x3)**2+(y2-y3)**2)
    c = math.sqrt((x1-x3)**2+(y1-y3)**2)
    if a+b>c and b+c>a and c+a>b:
        return a+b+c
    else:
        return -1

x1,y1 = map(float,input().split())
x2,y2 = map(float,input().split())
x3,y3 = map(float,input().split())
result = cal_divorce(x1,y1,x2,y2,x3,y3)
print(f'{result:.2f}')